﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nature
{
    public interface IMixtureDefinition
    {
        ReadOnlyArray<double> X { get; }

        ReadOnlyArray<string> SpeciesIDs { get; }

        Temperature Temperature { get; }

        Pressure Pressure { get; }
    }

    public class UnimixMixtureDefinition : IMixtureDefinition
    {
        readonly string[] m_speciesIDs;
        readonly double[] m_speciesX;
        public UnimixMixtureDefinition(IEnumerable<string> speciesIDs, Temperature temperature, Pressure pressure)
        {
            m_speciesIDs = speciesIDs.ToArray();
            m_speciesX = m_speciesIDs.Select(id=> 1d / (double)SpeciesIDs.Length).ToArray();
            this.Temperature = temperature;
            this.Pressure = pressure;
        }


        public ReadOnlyArray<double> X
        {
            get { return m_speciesX; }
        }

        public ReadOnlyArray<string> SpeciesIDs
        {
            get { return m_speciesIDs; }
        }

        public Temperature Temperature
        {
            get;
            private set;
        }

        public Pressure Pressure
        {
            get;
            private set;
        }
    }
}
